
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets" template="/template/main.xhtml">

	<ui:define name="body">
		<h:form>
			<p:toolbar>
				<p:toolbarGroup align="left">
					<p:commandButton title="#{messages['button.new']}" icon="ui-icon-document" action="#{licencaListMB.getNextView}"
						actionListener="#{licencaListMB.clear}" ajax="false" />

					<p:commandButton title="#{messages['button.delete']}" icon="ui-icon-trash" onclick="confirmation.show()"
						type="button" immediate="true" ajax="false" />

					<p:confirmDialog message="#{messages['label.confirm.delete']}" showEffect="bounce" hideEffect="explode"
						header="#{messages['label.dialog.alert']}!" severity="alert" widgetVar="confirmation">

						<h:commandButton value="#{messages['button.dialog.yes']}" action="#{licencaListMB.deleteSelection}"
							actionListener="#{licencaListMB.clear}" />
						<h:commandButton value="#{messages['button.dialog.no']}" onclick="confirmation.hide()" type="button" />
					</p:confirmDialog>
				</p:toolbarGroup>
			</p:toolbar>
			<p:dataTable id="list" var="bean" value="#{licencaListMB.resultList}">
				<f:facet name="header">#{messages['licenca.list.table.title']}</f:facet>
				<p:column style="width:1%;">
					<h:selectBooleanCheckbox value="#{licencaListMB.selection[bean.id]}"></h:selectBooleanCheckbox>
				</p:column>
				
				<p:column style="width:5%;" sortBy="#{bean.id}">
					<f:facet name="header">#{messages['licenca.label.id']}</f:facet>
					<h:outputText value="#{bean.id}" />
				</p:column>
						
				<p:column sortBy="#{bean.dataGeracao}">
					<f:facet name="header">#{messages['licenca.label.dataGeracao']}</f:facet>
					<h:commandLink action="#{licencaListMB.getNextView}" actionListener="#{licencaListMB.clear}">
						<h:outputText value="#{bean.dataGeracao}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
						
				<p:column sortBy="#{bean.dataVencimento}">
					<f:facet name="header">#{messages['licenca.label.dataVencimento']}</f:facet>
					<h:commandLink action="#{licencaListMB.getNextView}" actionListener="#{licencaListMB.clear}">
						<h:outputText value="#{bean.dataVencimento}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
						
				<p:column sortBy="#{bean.versao}">
					<f:facet name="header">#{messages['licenca.label.versao']}</f:facet>
					<h:commandLink action="#{licencaListMB.getNextView}" actionListener="#{licencaListMB.clear}">
						<h:outputText value="#{bean.versao}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
						
				<p:column sortBy="#{bean.servico}">
					<f:facet name="header">#{messages['licenca.label.servico']}</f:facet>
					<h:commandLink action="#{licencaListMB.getNextView}" actionListener="#{licencaListMB.clear}">
						<h:outputText value="#{bean.servico}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
						
				<p:column sortBy="#{bean.servicoSecundario}">
					<f:facet name="header">#{messages['licenca.label.servicoSecundario']}</f:facet>
					<h:commandLink action="#{licencaListMB.getNextView}" actionListener="#{licencaListMB.clear}">
						<h:outputText value="#{bean.servicoSecundario}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
						
				<p:column sortBy="#{bean.licenca}">
					<f:facet name="header">#{messages['licenca.label.licenca']}</f:facet>
					<h:commandLink action="#{licencaListMB.getNextView}" actionListener="#{licencaListMB.clear}">
						<h:outputText value="#{bean.licenca}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
						
				<p:column sortBy="#{bean.porta}">
					<f:facet name="header">#{messages['licenca.label.porta']}</f:facet>
					<h:commandLink action="#{licencaListMB.getNextView}" actionListener="#{licencaListMB.clear}">
						<h:outputText value="#{bean.porta}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
						
				<p:column sortBy="#{bean.portaSecundario}">
					<f:facet name="header">#{messages['licenca.label.portaSecundario']}</f:facet>
					<h:commandLink action="#{licencaListMB.getNextView}" actionListener="#{licencaListMB.clear}">
						<h:outputText value="#{bean.portaSecundario}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
						
				<p:column sortBy="#{bean.dataGravacao}">
					<f:facet name="header">#{messages['licenca.label.dataGravacao']}</f:facet>
					<h:commandLink action="#{licencaListMB.getNextView}" actionListener="#{licencaListMB.clear}">
						<h:outputText value="#{bean.dataGravacao}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
						
			</p:dataTable>
		</h:form>

	</ui:define>
</ui:composition>